package dao;

import dao.tables.GROUPE;
import dao.tables.INSTRUMENT;
import dao.tables.MEMBRE;
import dao.tables.OEUVRE;
import dao.tables.PERSONNE;
import dao.tables.RESPONSABILITE;
import dao.tables.SPECIALITE;

public abstract class AbstractDAOFactory<T> {

	public abstract DAO<PERSONNE> getPersonneDAO();

	public abstract DAO<MEMBRE> getMembreDAO();

	public abstract DAO<RESPONSABILITE> getResponsabiliteDAO();

	public abstract DAO<OEUVRE> getOeuvreDAO();

	public abstract DAO<INSTRUMENT> getInstrumentDAO();

	public abstract DAO<SPECIALITE> getSpecialiteDAO();

	public abstract DAO<GROUPE> getGroupeDAO();

	public abstract DAOList<INSTRUMENT> getListInstrumentDAO();

	public abstract DAOList<SPECIALITE> getListSpecialiteDAO();

	public abstract DAOList<MEMBRE> getListMembreDAO();

	public abstract DAOList<GROUPE> getListGroupeDAO();

	public static <T> AbstractDAOFactory<T> getFactory() {
		return new DAOFactory<T>();
	}

	public static <T> AbstractDAOFactory<T> getFactory(FactoryType type) {
		if (type.equals(FactoryType.ORACLE_DAO_FACTORY)) return new DAOFactory<T>();
		if (type.equals(FactoryType.DAO_FACTORY)) return new DAOFactory<T>();
		if (type.equals(FactoryType.XML_DAO_Factory)) return null;
		return null;
	}
}
